package com.wash.shoes.controller.pc;

import java.util.Arrays;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.R;
import com.wash.shoes.domain.vo.OrderCommentVo;
import com.wash.shoes.entity.OrderCommentPo;
import com.wash.shoes.service.OrderCommentService;
import io.swagger.annotations.Api;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;

/**
 * 订单的评价Controller
 * 
 * @author ruoyi
 * @date 2025-10-14
 */
@Api(tags = {"PC-评价管理"})
@RestController
@RequestMapping({"/commentManage", "/dev-api/commentManage"})
public class OsOrderCommentController extends BaseController
{
    @Autowired
    private OrderCommentService orderCommentService;

    /**
     * 查询订单的评价列表
     */
    @PreAuthorize("@ss.hasPermi('system:comment:list')")
    @PostMapping("/list")
    public R<Page<OrderCommentVo>> list(@RequestBody OrderCommentPo osOrderComment)
    {
        Page<OrderCommentVo> list = orderCommentService.pageList(osOrderComment);
        return R.ok(list);
    }




    /**
     * 删除订单的评价
     */
    @PreAuthorize("@ss.hasPermi('system:comment:remove')")
    @Log(title = "订单的评价 删除", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable String[] ids)
    {
        return toAjax(orderCommentService.removeByIds(Arrays.asList(ids)));
    }
}
